package com.itheima.sh.controller;

import com.itheima.sh.feign.UserFeignApi;
import com.itheima.sh.pojos.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 飞羽鸿蒙
 * @date: 2020/12/20 19:44
 */
@RestController
@RequestMapping("/feign")
public class FeignController {

    @Autowired
    UserFeignApi userFeignApi;

    @GetMapping("{id}")
    public User queryById(@PathVariable("id") String username) {

        return userFeignApi.queryById(username);
    }

}
